select FORMMAIN_0033.ID as "TOWID",FORMSON_0034.ID,FORMSON_0034.FIELD0008,FORMSON_0034.FIELD0012,FORMSON_0034.FIELD0013,FORMSON_0034.FIELD0024,FORMSON_0034.FIELD0036,FORMSON_0034.FIELD0011,FORMSON_0034.FIELD0064,
FORMSON_0034.FORMMAIN_ID as "FId",COL_SUMMARY.id as "Liuc",
ORG_MEMBER.NAME as USERNAME,ORG_UNIT.NAME as DEPTNAME,"temp_org_member_group"."company"as ADDRESS,
FORMSON_0034.FIELD0024 as "USERID",
FORMSON_0034.ID as "CID",to_char(FORMSON_0034.FIELD0036,'yyyyMMdd') as "BEGDAY",to_char(FORMSON_0034.FIELD0012,'yyyyMMdd') as "BEGDAYY",
to_char(FORMSON_0034.FIELD0012,'HH24MISS') as "SBSJ",to_char(FORMSON_0034.FIELD0036,'HH24MISS') as "XBSJ",
FORMMAIN_0033.field0002 as "DJLSH",formmain_0033.field0063 as "BT",
FORMSON_0034.ID as "邮箱唯一编号",FORMSON_0034.FIELD0024 as "G-HR职员编号",FORMMAIN_0033.ID as "SEQ",FORMSON_0034.FIELD0064 as "考勤区分",
to_char(FORMSON_0034.FIELD0036,'yyyyMMdd') as "考勤日期2",to_char(FORMSON_0034.FIELD0012,'yyyyMMdd') as "考勤日期1",
to_char(FORMSON_0034.FIELD0012,'HH24MISS') as "上班时间",to_char(FORMSON_0034.FIELD0036,'HH24MISS') as "下班时间",FORMSON_0034.FIELD0013 as "事由"
from
FORMSON_0034
left outer join FORMMAIN_0033 on FORMSON_0034.FORMMAIN_ID=FORMMAIN_0033.ID
left outer join  COL_SUMMARY on FORMSON_0034.FORMMAIN_ID=COL_SUMMARY.form_recordid
LEFT outer JOIN ORG_MEMBER ON ORG_MEMBER.CODE = FORMSON_0034.FIELD0024
LEFT outer JOIN "temp_org_member_group" ON ORG_MEMBER.ID = "temp_org_member_group"."member_id"
LEFT outer JOIN ORG_UNIT ON ORG_MEMBER.ORG_DEPARTMENT_ID = ORG_UNIT."ID"
where FORMSON_0034.FORMMAIN_ID=?
AND ORG_MEMBER.IS_ENABLE = 1 AND ORG_MEMBER.IS_DELETED = 0